﻿CREATE TABLE [transaction].[TransactionDetail] (
    [TransactionDetailID] INT          IDENTITY (1, 1) NOT NULL,
    [TransactionID]       INT          NULL,
    [TransactionTypeID]   INT          NULL,
    [CreatedBy]           VARCHAR (50) NULL,
    [CreatedDate]         DATETIME     NULL,
    [UpdatedBy]           VARCHAR (50) NULL,
    [UpdatedDate]         DATETIME     NULL,
    [EndDate]             DATETIME     NULL,
    CONSTRAINT [PK_TransactionDetail] PRIMARY KEY CLUSTERED ([TransactionDetailID] ASC),
    CONSTRAINT [FK_TransactionDetail_Transaction] FOREIGN KEY ([TransactionID]) REFERENCES [transaction].[Transaction] ([TransactionID]),
    CONSTRAINT [FK_TransactionDetail_TransactionType] FOREIGN KEY ([TransactionTypeID]) REFERENCES [transaction].[TransactionType] ([TransactionTypeID])
);

